﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="pgEncriptar.aspx.cs" Inherits="EGuayas.Web.pgEncriptar" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>PLASA</title>
    <link rel="Shortcut Icon" href="favicon.ico" type="image/x-icon" />
    <link  href="Resources/css/StyleLogin.css"  rel="stylesheet" />
    <!-- Load Ext JS --> 
    <script src="Resources/js/Global.js"></script>
</head>
 <script type="text/javascript">
   
 </script>
<body>
<!-- Maquetado y aplicar css Login by: Diana Ortega Salinas -->
<!--Diseño grafico: Ideabox -->
<div id="header">
         <div id="header-welcome"/>
    </div>
 <div id="content-wrapper" class="clearfixd">
        <div id="izquierda"></div>
             <div id="derecha"></div>
     <div id="content-wrapper-welcome">
          <div id="main-content-welcome" class="clearfixd">
            <div id="actions-cont-welcome">
                <div id="title-welcome">BIENVENIDO</div>
                <div id="msg-welcome">
                    <p>
                       Aspx Test. Encriptar clave de usuario.
                    </p>
                </div>
                <div id="nav-home-welcome">
                    <ul>
                        <li id="nav-help-btn"><span><a href="http://www.guayas.gob.ec/medioambiente"></a></span></li>
                        <li class="nav-sep-btns"></li>
                        <li id="nav-security-btn"><span><a href="http://www.guayas.gob.ec/"></a></span></li>
                        <li class="nav-sep-btns"></li>
                       
                    </ul>
                </div><!-- Fin #nav-home-welcome -->
            </div>
  
            <div id="login-cont-welcome">
            
                <div id="inner-login-cont">
                     <form id="frmLogin" runat="server"  >
                    <ext:ResourceManager ID="ResourceManager1" runat="server" />
                    <%-- 
             <ext:Window 
            ID="WindowLogin" 
            runat="server" 
            Closable="false"
            Resizable="false"
            Height="150" 
            Icon="Lock" 
            Title="Login"
            Draggable="false"
            Width="350"
            Modal="true"
            BodyPadding="5"
            Layout="FormLayout">
            <Items>
            --%>
                             <ext:TextField 
                    ID="txtPassword" 
                    FieldCls="txtborder"
                    runat="server" 
                  
                    FieldLabel="Clave" 
                    AllowBlank="false" 
                    BlankText="Clave requerida"
                       Padding="5"
                     Width="250"
                    EnableKeyEvents="true">
             
                    <Listeners>
                        <KeyPress Handler="return pgFn.HandleKeyPress(item,e);">
                            
                            
                        </KeyPress>
                    </Listeners>
                    </ext:TextField>
                <ext:TextField                   
                    ID="txtUsername" 
                     FieldCls="txtborder"
                    runat="server"                     
                    FieldLabel="Encriptado" 
                    AllowBlank="false"
                  
                      Width="250"
                     Padding="5"
                     />
           
            
                    
                    <br />
               <ext:Label ID="lblMessage" runat="server" />
 <%-- 
            </Items>
            <Buttons>
                --%>
               
                           
                           
                            <ext:ImageButton ID="btnLogin" runat="server"  Align="Right" Margin="10" Padding="25"
                             ImageUrl="Resources/css/img_global/login_btn_aceptar02.png"
                             >
                            <Listeners>
                                <Click Handler="
                                    if (!#{txtPassword}.validate()) {
                                        Ext.Msg.alert('Error','Clave requerido');
                                        // return false to prevent the btnLogin_Click Ajax Click event from firing.
                                        return false; 
                                    }" />
                            </Listeners>
                            <DirectEvents>
                                <Click OnEvent="btnLogin_Click"  Failure="pgFn.HandleError">
                                    <ExtraParams>
                                       
                                        <ext:Parameter Name="clave"  Value ="#{txtPassword}.getValue()"   Mode="Raw" /> 
                                    </ExtraParams>
                                    <EventMask ShowMask="true" Msg="Verificando..." MinDelay="500" />
                                </Click>
                            </DirectEvents>
                          </ext:ImageButton>                 
                            <ext:ImageButton  ID="btnRegistrar" runat="server" Align="Right" Margin="10" Padding="15"
                                     ImageUrl="Resources/css/img_global/login_btn_aceptar01.png">
                                <Listeners>
                                    <Click Handler="#{txtPassword}.setValue('');#{txtUsername}.setValue('');" />
                                </Listeners>
                            </ext:ImageButton>
                            
                            
              <%--   
            </Buttons>
        </ext:Window>
        --%>
        </form>
                   
        </div>
    </div>
            <!--
            <div class="clearfix"></div>
            <div id="browser-warning">
                Para el correcto funcionamiento de este sitio web se recomienda utilizar Firefox 4+, Google Chrome 11+, Safari 5+, Opera 10+ o Internet Explorer 9.0 o superior.
            </div>
            -->
        </div><!--fin #main-content-welcome -->
        
        </div>
        <div id="login-footer"> </div>  
    </div>
 
    <ext:XScript ID="XScript1" runat="server">
        <script type="text/javascript">
            var pgFn = new Object();
            //Presionar <ENTER> invocar metodo de autentificar
            pgFn.HandleKeyPress = function (item, e) {
               if (e.getKey() == Ext.EventObject.ENTER) {
                    e.preventDefault();
                    App.btnLogin.fireEvent('click');
                    return (true);
                }
                return (false);

            };
            //Msg de error
             pgFn.HandleError = function (result) {
                Ext.Msg.show({
                    title: 'Error',
                    msg: 'Clave no valido',
                    buttons: Ext.Msg.ERROR,                   
                    animEl: 'elId'
                });
            

            };
                      
          
            function getRootWebSitePath()
            {
                var _location = document.location.toString();
                var applicationNameIndex = _location.indexOf('/', _location.indexOf('://') + 3);
                var applicationName = _location.substring(0, applicationNameIndex) + '/';
                var webFolderIndex = _location.indexOf('/', _location.indexOf(applicationName) + applicationName.length);
                var webFolderFullPath = _location.substring(0, webFolderIndex);

                return webFolderFullPath;
            }
           
       </script>
    </ext:XScript>
</body>
</html>
